#ifndef _GAME_H
#define _GAME_H

#include <ctime>
#include <conio.h>
#include <fstream>
#include "defines.h"
#include "Timer.h"
#include "PenteBoard.h"
#include "screen.h"
#include "charInfo.h"

class Game
{
private:
	//instance of the board object
	PenteBoard Board;
	
	//Timer Object
	Timer timeKeep;

	//board origin??
	COORD origin;

	//display object
	Screen *gameScreen;

	//keeps track of how many captures have been performed
	int capture_count[PLAYERS];

	//winning player
	int winner;

	//input flags
	bool inputFlags[10]; // 10 was picked as a random default size
	bool inputLock;


	bool paused;

	int STATE;  // state flag

	//Cursor Object
	Cursor cursor;

public:
	Game(); //Game class ctor
	~Game();//Game class dtor

	void initGame();
	void loadTitleScreen();
	void gameLoop();
	void updateGame(); //This function is only called on a successful capture of a node
	void handleInput();
//	bool testValidMove( int ); //Deprecated (moved to node class) -Kaero
	void  gameRules();
	void gameOver();
	void loadVictoryFile();

	//display functions
	void drawGame();
	void printRules();


	//**JDP Additions**
	void getInput();
	void process();
	Cursor* getCursor(){ return &cursor; }
	int getRow( int x ){ return x / BOARD_SIZE; }
	int getCol( int y ){ return y % BOARD_SIZE; }
	int RowCol( int x, int y ){ return x * BOARD_SIZE + y; }

};

#endif